program corners;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  n, sum1, x0, y0, i, sum2 : integer;
  mass : array of integer;
  fin : textFile;

begin
  sum1:= 0;
  sum2:= 0;
  readln(x0, y0);
  assignFile (fin,'input.txt');
  reset(fin);
  read(fin,n);
  Setlength(mass,2*n+1);
    for i:=1 to 2*n do
      read(fin, mass[i]);

  for i :=1 to 2*n do
  if (i mod 2 = 0) then
  begin
  sum1 := sum1 + abs((mass[i]- x0)*(mass[i+3]-y0) - (mass[i+2]- x0)*(mass[i+1] - y0))div 2;
  end;

  for i :=1 to 2*n do
  if (i mod 2 = 0) then
  begin
   sum2 := sum2 + abs((mass[i]-mass[i+4])*(mass[i+3]-mass[i+5]) - (mass[i+2]- mass[i+4])*(mass[i+1] - mass[i+5]))div 2;
  end;

  if (sum1 = sum2) then
  begin
  writeln('ok');
  end;
  if (sum1 <> sum2) then
  begin
  writeln('out');
  end;
  readln;

end.


